The IP Security (IPSec) standard provides techniques for protecting both confidentiality and integrity of data transferred over a network. IPSec is described in IP Security Internet Engineering Task Force (IETF) Request for Comments (RFC) 2401, published November 1998. Because IPSec provides a way to encrypt and decrypt data below the Transmission Control Protocol (TCP)/User Datagram Protocol (UDP) layer, the protection is transparent to applications that transfer data. Thus, a system may utilize IPSec without requiring changes at the application level. However, the algorithms used for cryptography (crypto) operations (e.g., encryption, decryption, authentication) on the data for IPSec require many processor cycles to execute. The processor cycles spent on crypto operations decrease the cycles available to applications and other parts of the protocol stack. This in turn decreases throughput in the system.
One solution to this problem is to offload the cryptography operations to hardware external to the processor, for example, a network interface card (NIC). One offload technique is to decrypt the data directly off the network connection before the packet is transferred to host memory. Often, data transfers between the NIC and host memory are accomplished using a direct memory access (DMA) device. The process of decrypting and authenticating ingress data before it is transferred to host memory is referred to as “Inline Receive.”
An alternative to Inline Receive is a technique referred to as “Secondary Use,” which uses an out-of-band acceleration technique to decrypt receive packets. All packets received from the network are transferred to host memory via DMA transfer. The network driver then parses each received packet to match it with a corresponding security association (SA). A security association is a data structure that contains information necessary to encrypt, decrypt and or authenticate a packet of data.
Assuming the cryptographic operation processor in located on the NIC, the driver must instruct the NIC processor to transfer the packet across the bus, perform the cryptographic operation on the packet and then send the packet back across the bus to host memory. The result is that the packet is transferred across the bus three times, which is an inefficient use of host resources. The Secondary Use technique further introduces latency that can degrade throughput of protocols that are sensitive to round trip timing delays, for example, TCP.
Inline Receive provides better overall performance as compared to Secondary Use at the expense of increased complexity and expense of the network interface. One of the factors that results in increased expense is that, for Inline Receive, the network interface generally stores the SAs for the incoming data streams. In order to support a large number of incoming data streams, the network interface would then store a large number of SAs, which are generally stored in a cache memory on the network interface. Increasing this cache size increases the expense of the network interface.